//
//  BKButton.m
//  BaseFrame
//
//  Created by 孟学浩 on 2017/1/9.
//  Copyright © 2017年 com.mxh. All rights reserved.
//

#import "BKButton.h"

@implementation BKButton

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupSelf];
    }
    return self;
}

- (instancetype)init{
    if (self = [super init]) {
        [self setupSelf];
    }
    return self;
}

- (instancetype)initWithUpInsideHandle:(void (^)(UIButton *))upInsideHandle{
    if (self = [super init]) {
        [self setupSelf];
        self.upInsideHandle = upInsideHandle;
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame upInsideHandle:(void (^)(UIButton *))upInsideHandle{
    if (self = [super initWithFrame:frame]) {
        [self setupSelf];
        self.upInsideHandle = upInsideHandle;
    }
    return self;
}

- (void)setupSelf{
    [self addTarget:self action:@selector(upInsideEvent) forControlEvents:UIControlEventTouchUpInside];
}

- (void)upInsideEvent{
    if (self.upInsideHandle) {
        self.upInsideHandle(self);
    }
}

@end
